<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="UTF-8">
	<title>黔南民族师范学院综合教育学分认定系统</title>

	<link rel="stylesheet" href="/jquery-easyui-1.3.5/themes/icon.css" />
	<link rel="stylesheet" href="/jquery-easyui-1.3.5/themes/default/easyui.css"/>

	<script type="text/javascript" src="/jquery-easyui-1.3.5/jquery.min.js"></script>
	<script type="text/javascript" src="/jquery-easyui-1.3.5/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="/jquery-easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
    
    <style type="text/css">
    	form div{	
    		margin:20px auto;
    		text-align:center;
    	}
    </style>
    <script type="text/javascript">
    	$(function(){
    		//完成数据回显
    		var dg = parent.$("iframe[title='用户管理']").get(0).contentWindow.$("#dg");
    		var rows = dg.datagrid("getSelections");
    		
			$("#cc").combobox({    
			    url:'/user/queryAllRolesById?id='+rows[0].id,
			    valueField:'roleId',
			    textField:'roleName',
			    panelHeigth:'auto',
			    panelWidth:140,
			    width:160,
			    multiple:true,
			    editable:false,
			});   
    		
    		$("#ff").form('load',{
    			id:rows[0].id,
    			username:rows[0].username,
    			truename:rows[0].truename,
    		});
    		
    		$("#btn").click(function(){
    			$("#ff").form('submit',{
    					url:'/user/saveroles',
    					success:function(){
    						parent.$("#win").window("close");
    						dg.datagrid("reload");	
    						dg.datagrid("uncheckAll");	
    						}
    					}
    				);
    		});
    	});
    	
    </script>
  </head>
  
  <body>
  	<form id="ff" method="post">
	    <div>
	        <label >用户名称:</label>
	        <input type="text" name="username" readonly="readonly"/>
	    </div>   
	    <div>   
	        <label>真实姓名:</label>
	        <input type="text" name="truename" readonly="readonly"/>   
	    </div> 
	    <div>   
	        <label >角色名称:</label>
	        <input id="cc" name="roles" class="easyui-combobox">
	    </div>
	    <div>
	    	<a id="btn" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-ok'">保存</a> 
	    	<input type="hidden" name="id" />

	    </div>

	</form>  
  </body>
</html>
